import NProgress from 'nprogress'
import { createRouter, createWebHashHistory } from 'vue-router'
import { commonRouter } from '@/router/route'

NProgress.configure({ showSpinner: false })

const router = createRouter({
  history: createWebHashHistory(),
  routes: commonRouter,
})

router.beforeEach(async () => {
  NProgress.start()

  return true
})

router.afterEach(() => {
  NProgress.done()
})

export default router
